package com.qf.flying;

import java.awt.image.BufferedImage;

public abstract class FlyObject
{
    boolean isAward = false;
    public Award award;
    //根据生命与剩余的声明算血条
    public int life;
    public int totalLife;

    public int x;//坐标x轴
    public int y;//坐标y轴
    public int width;//宽度
    public int height;//高度
    public BufferedImage image;
    //定义走步方法

    public abstract void step();

    //判断是否被击中，是则返回true
    public boolean shootBy(Bullet b)
    {
        if (isShot(b))
        {
            life -= b.getDamage();
        }
        if (life <= 0)
        {
            return true;
        }
        return false;
    }
    public abstract boolean isShot(Bullet b);
}
